gtk_tool_shell_get_ellipsize_mode
gtk_tool_shell_get_icon_size
gtk_tool_shell_get_orientation
-gtk_tool_shell_get_relief_style
gtk_tool_shell_get_style
gtk_tool_shell_get_text_alignment
gtk_tool_shell_get_text_orientation
gtk_toolbar_get_show_arrow
gtk_toolbar_get_style
gtk_toolbar_get_icon_size
-gtk_toolbar_get_relief_style
gtk_toolbar_set_style
gtk_toolbar_set_icon_size
gtk_tool_item_get_icon_size
gtk_tool_item_get_orientation
gtk_tool_item_get_toolbar_style
-gtk_tool_item_get_relief_style
gtk_tool_item_get_text_alignment
gtk_tool_item_get_text_orientation
gtk_tool_item_retrieve_proxy_menu_item
gtk_container_add (GTK_CONTAINER (button), priv->box);
gtk_widget_show_all (priv->box);
- gtk_button_set_relief (GTK_BUTTON (priv->arrow_button),
- gtk_tool_item_get_relief_style (GTK_TOOL_ITEM (button)));
-
gtk_widget_queue_resize (GTK_WIDGET (button));
}
GtkToolbar *toolbar);
static void gtk_toolbar_arrow_button_clicked (GtkWidget *button,
GtkToolbar *toolbar);
-static void gtk_toolbar_update_button_relief (GtkToolbar *toolbar);
static gboolean gtk_toolbar_popup_menu (GtkWidget *toolbar);
static void gtk_toolbar_reconfigured (GtkToolbar *toolbar);
int height,
gpointer data);
-static GtkReliefStyle get_button_relief (GtkToolbar *toolbar);
static gint get_max_child_expand (GtkToolbar *toolbar);
/* methods on ToolbarContent 'class' */
static GtkIconSize toolbar_get_icon_size (GtkToolShell *shell);
static GtkOrientation toolbar_get_orientation (GtkToolShell *shell);
static GtkToolbarStyle toolbar_get_style (GtkToolShell *shell);
-static GtkReliefStyle toolbar_get_relief_style (GtkToolShell *shell);
static void toolbar_rebuild_menu (GtkToolShell *shell);
G_MAXINT,
GTK_PARAM_READABLE));
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_enum ("button-relief",
- P_("Button relief"),
- P_("Type of bevel around toolbar buttons"),
- GTK_TYPE_RELIEF_STYLE,
- GTK_RELIEF_NONE,
- GTK_PARAM_READABLE));
-
binding_set = gtk_binding_set_by_class (klass);
add_arrow_bindings (binding_set, GDK_KEY_Left, GTK_DIR_LEFT);
iface->get_icon_size = toolbar_get_icon_size;
iface->get_orientation = toolbar_get_orientation;
iface->get_style = toolbar_get_style;
- iface->get_relief_style = toolbar_get_relief_style;
iface->rebuild_menu = toolbar_rebuild_menu;
}
G_CALLBACK (gtk_toolbar_arrow_button_press), toolbar);
g_signal_connect (priv->arrow_button, "clicked",
G_CALLBACK (gtk_toolbar_arrow_button_clicked), toolbar);
- gtk_button_set_relief (GTK_BUTTON (priv->arrow_button),
- get_button_relief (toolbar));
gtk_widget_set_focus_on_click (priv->arrow_button, FALSE);
gtk_widget_set_clip (widget, &clip);
}
-static void
-gtk_toolbar_update_button_relief (GtkToolbar *toolbar)
-{
- GtkToolbarPrivate *priv = toolbar->priv;
- GtkReliefStyle relief;
-
- relief = get_button_relief (toolbar);
-
- if (relief != gtk_button_get_relief (GTK_BUTTON (priv->arrow_button)))
- {
- gtk_toolbar_reconfigured (toolbar);
-
- gtk_button_set_relief (GTK_BUTTON (priv->arrow_button), relief);
- }
-}
-
static void
gtk_toolbar_style_updated (GtkWidget *widget)
{
GTK_WIDGET_CLASS (gtk_toolbar_parent_class)->style_updated (widget);
priv->max_homogeneous_pixels = -1;
- gtk_toolbar_update_button_relief (GTK_TOOLBAR (widget));
}
static GList *
return toolbar->priv->icon_size;
}
-/**
- * gtk_toolbar_get_relief_style:
- * @toolbar: a #GtkToolbar
- *
- * Returns the relief style of buttons on @toolbar. See
- * gtk_button_set_relief().
- *
- * Returns: The relief style of buttons on @toolbar.
- *
- * Since: 2.4
- **/
-GtkReliefStyle
-gtk_toolbar_get_relief_style (GtkToolbar *toolbar)
-{
- g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), GTK_RELIEF_NONE);
-
- return get_button_relief (toolbar);
-}
-
/**
* gtk_toolbar_set_show_arrow:
* @toolbar: a #GtkToolbar
gtk_widget_show_all (widget);
}
-/*
- * Getters
- */
-static GtkReliefStyle
-get_button_relief (GtkToolbar *toolbar)
-{
- GtkReliefStyle button_relief = GTK_RELIEF_NORMAL;
-
- gtk_widget_style_get (GTK_WIDGET (toolbar),
- "button-relief", &button_relief,
- NULL);
-
- return button_relief;
-}
-
static gint
get_max_child_expand (GtkToolbar *toolbar)
{
return priv->style;
}
-static GtkReliefStyle
-toolbar_get_relief_style (GtkToolShell *shell)
-{
- return get_button_relief (GTK_TOOLBAR (shell));
-}
-
static void
toolbar_rebuild_menu (GtkToolShell *shell)
{
GDK_AVAILABLE_IN_ALL
void gtk_toolbar_unset_icon_size (GtkToolbar *toolbar);
-GDK_AVAILABLE_IN_ALL
-GtkReliefStyle gtk_toolbar_get_relief_style (GtkToolbar *toolbar);
GDK_AVAILABLE_IN_ALL
gint gtk_toolbar_get_drop_index (GtkToolbar *toolbar,
gint x,
if (box)
gtk_widget_show (box);
- gtk_button_set_relief (GTK_BUTTON (button->priv->button),
- gtk_tool_item_get_relief_style (GTK_TOOL_ITEM (button)));
-
gtk_tool_item_rebuild_menu (tool_item);
gtk_widget_queue_resize (GTK_WIDGET (button));
* - gtk_tool_shell_get_orientation()
* - gtk_tool_shell_get_style()
* - gtk_tool_shell_get_icon_size()
- * - gtk_tool_shell_get_relief_style()
* to find out what the toolbar should look like and change
* themselves accordingly.
**/
return gtk_tool_shell_get_style (GTK_TOOL_SHELL (parent));
}
-/**
- * gtk_tool_item_get_relief_style:
- * @tool_item: a #GtkToolItem
- *
- * Returns the relief style of @tool_item. See gtk_button_set_relief().
- * Custom subclasses of #GtkToolItem should call this function in the handler
- * of the #GtkToolItem::toolbar_reconfigured signal to find out the
- * relief style of buttons.
- *
- * Returns: a #GtkReliefStyle indicating the relief style used
- * for @tool_item.
- *
- * Since: 2.4
- **/
-GtkReliefStyle
-gtk_tool_item_get_relief_style (GtkToolItem *tool_item)
-{
- GtkWidget *parent;
-
- g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_RELIEF_NONE);
-
- parent = gtk_widget_get_parent (GTK_WIDGET (tool_item));
- if (!parent || !GTK_IS_TOOL_SHELL (parent))
- return GTK_RELIEF_NONE;
-
- return gtk_tool_shell_get_relief_style (GTK_TOOL_SHELL (parent));
-}
-
/**
* gtk_tool_item_get_text_alignment:
* @tool_item: a #GtkToolItem:
GDK_AVAILABLE_IN_ALL
GtkToolbarStyle gtk_tool_item_get_toolbar_style (GtkToolItem *tool_item);
GDK_AVAILABLE_IN_ALL
-GtkReliefStyle gtk_tool_item_get_relief_style (GtkToolItem *tool_item);
-GDK_AVAILABLE_IN_ALL
gfloat gtk_tool_item_get_text_alignment (GtkToolItem *tool_item);
GDK_AVAILABLE_IN_ALL
GtkOrientation gtk_tool_item_get_text_orientation (GtkToolItem *tool_item);
typedef GtkToolShellIface GtkToolShellInterface;
G_DEFINE_INTERFACE (GtkToolShell, gtk_tool_shell, GTK_TYPE_WIDGET);
-static GtkReliefStyle gtk_tool_shell_real_get_relief_style (GtkToolShell *shell);
static GtkOrientation gtk_tool_shell_real_get_text_orientation (GtkToolShell *shell);
static gfloat gtk_tool_shell_real_get_text_alignment (GtkToolShell *shell);
static PangoEllipsizeMode gtk_tool_shell_real_get_ellipsize_mode (GtkToolShell *shell);
static void
gtk_tool_shell_default_init (GtkToolShellInterface *iface)
{
- iface->get_relief_style = gtk_tool_shell_real_get_relief_style;
iface->get_text_orientation = gtk_tool_shell_real_get_text_orientation;
iface->get_text_alignment = gtk_tool_shell_real_get_text_alignment;
iface->get_ellipsize_mode = gtk_tool_shell_real_get_ellipsize_mode;
}
-static GtkReliefStyle
-gtk_tool_shell_real_get_relief_style (GtkToolShell *shell)
-{
- return GTK_RELIEF_NONE;
-}
-
static GtkOrientation
gtk_tool_shell_real_get_text_orientation (GtkToolShell *shell)
{
return GTK_TOOL_SHELL_GET_IFACE (shell)->get_style (shell);
}
-/**
- * gtk_tool_shell_get_relief_style:
- * @shell: a #GtkToolShell
- *
- * Returns the relief style of buttons on @shell. Tool items must not call this
- * function directly, but rely on gtk_tool_item_get_relief_style() instead.
- *
- * Returns: The relief style of buttons on @shell.
- *
- * Since: 2.14
- **/
-GtkReliefStyle
-gtk_tool_shell_get_relief_style (GtkToolShell *shell)
-{
- GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
-
- return iface->get_relief_style (shell);
-}
-
/**
* gtk_tool_shell_rebuild_menu:
* @shell: a #GtkToolShell
* @get_icon_size: mandatory implementation of gtk_tool_shell_get_icon_size().
* @get_orientation: mandatory implementation of gtk_tool_shell_get_orientation().
* @get_style: mandatory implementation of gtk_tool_shell_get_style().
- * @get_relief_style: optional implementation of gtk_tool_shell_get_relief_style().
* @rebuild_menu: optional implementation of gtk_tool_shell_rebuild_menu().
* @get_text_orientation: optional implementation of gtk_tool_shell_get_text_orientation().
* @get_text_alignment: optional implementation of gtk_tool_shell_get_text_alignment().
GtkIconSize (*get_icon_size) (GtkToolShell *shell);
GtkOrientation (*get_orientation) (GtkToolShell *shell);
GtkToolbarStyle (*get_style) (GtkToolShell *shell);
- GtkReliefStyle (*get_relief_style) (GtkToolShell *shell);
void (*rebuild_menu) (GtkToolShell *shell);
GtkOrientation (*get_text_orientation) (GtkToolShell *shell);
gfloat (*get_text_alignment) (GtkToolShell *shell);
GDK_AVAILABLE_IN_ALL
GtkToolbarStyle gtk_tool_shell_get_style (GtkToolShell *shell);
GDK_AVAILABLE_IN_ALL
-GtkReliefStyle gtk_tool_shell_get_relief_style (GtkToolShell *shell);
-GDK_AVAILABLE_IN_ALL
void gtk_tool_shell_rebuild_menu (GtkToolShell *shell);
GDK_AVAILABLE_IN_ALL
GtkOrientation gtk_tool_shell_get_text_orientation (GtkToolShell *shell);